<template>
  <div class="model-container">
    <div class="listName">等级管理</div>

    <!--表格-->
    <el-card style="margin-top: 10px">
      <div class="table-wrapper">
        <el-table v-loading="!dataOption" :stripe="true" :data="dataOption" border empty-text="暂无数据" @selection-change="changeFun">

          <el-table-column align="center" width="55" label="序号" type="index" />

          <el-table-column align="center" prop="sellerName" label="等级名称" />

          <el-table-column align="center" prop="address" label="晋级所需积分" />

          <el-table-column align="center" prop="sellerId" label="创建时间" />

          <el-table-column align="center" label="操作">
            <template slot-scope="scope">
              <el-button type="primary" size="mini" plain @click="edit(scope.row)">修改</el-button>
              <el-button type="danger" size="mini" plain @click="delete(scope.row)">删除</el-button>
            </template>
          </el-table-column>

        </el-table>

        <!--分页-->
        <el-pagination
          :current-page="pageNo"
          :page-sizes="[10, 20, 30]"
          :page-size="pageSize"
          :total="rowCount"
          background
          layout="total, sizes, prev, pager, next, jumper"
          @size-change="handleSizeChange"
          @current-change="handleCurrentChange" />
      </div>
    </el-card>

  </div>
</template>

<script>
// import * as grade from '../../api/grade.js'
export default {
  components: {},
  data() {
    return {
      videoAllow: 0,
      allAllow: 0,

      isRouterAlive: true,
      // 输入禁用
      disableIinput: false,
      // 省市区
      provinceList: null,
      cityList: null,
      areaList: null,
      // 页面搜索
      seacherParam: {
        sellerName: '',
        censorStatus: -1
      },
      searchShow: false,
      pageNo: 1,
      pageSize: 10,
      rowCount: null, // 总条数
      // 弹框
      dialogType: 1, // 1--增加  2--编辑  3--审核   4--重新审核
      dialogState: false,
      // 按钮状态
      buttonState: false,
      // 列表数据
      dataOption: null,
      // 提交内容
      disabled: false,
      datavalID: [],
      dialogBindData: {

      },
      rules: {

      }
    }
  },
  beforeMount() {
    this.getList()
  },
  methods: {
    seachFun() {

    },

    // 重置
    resetFun() {
      this.$refs.seacherParam.resetFields()
      this.pageNo = 1
      this.pageSize = 10
      this.getList()
    },

    handleSizeChange(val) {
      console.log(`每页 ${val} 条`)
      this.pageSize = val
      this.getList()
    },
    handleCurrentChange(val) {
      console.log(`当前页: ${val}`)
      this.pageNo = val
      this.getList()
    },
    handleClose() {
      for (const key in this.dialogBindData) {
        if (key === 'sellerType') {
          this.dialogBindData[key] = 1
        } else if (key === 'settlementPeriod') {
          this.dialogBindData[key] = 1
        } else {
          this.dialogBindData[key] = ''
        }
      }
      this.dialogState = false
      this.disabled = false
      this.disableIinput = false
      this.isRouterAlive = false
      this.$refs.dialogBindData.clearValidate()
    },

    getList() {

    },

    // 编辑
    edit(data) {
      this.$router.push({
        name: '/v1/merchant_add',
        params: {
          data: data,
          dialogType: 2
        }
      })
    },
    // 提交
    submmitFun() {

    },
    // 删除
    changeFun(data) {
      this.datavalID = data
    }

  }
}

</script>
<style type="text/scss" lang="scss">
	.formBody {
    .el-dialog__body{
      padding: 10px;
    }
  }
</style>
<style type="text/scss" lang="scss" scoped>
	.formBody{
    height: 600px;
    overflow: auto;
  }
  .statusClass{
    cursor: pointer;
    color: #33CC00;
  }
  .statusClassnew{
    cursor: pointer;
    color: #FF0033;
  }
</style>
